package com.example;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.example.base.job.Job;
import com.example.base.utils.FastJsonUtils;
import org.checkerframework.checker.units.qual.A;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Test {

    public static String str="{\"nodeId\":\"0223067d-6827-4017-966b-65e3d52d8d2c\",\"name\":\"请假审批\",\"nodeConfig\":{\"nodeId\":\"8b68569c-2e0a-4e6f-b494-ba8a080e1681\",\"nodeName\":\"发起人\",\"type\":0,\"nodeRoleList\":[],\"childNode\":{\"nodeId\":\"492397dc-2feb-404f-9853-69849aac9ef8\",\"nodeName\":\"条件路由\",\"type\":4,\"conditionNodes\":[{\"nodeId\":\"1a0854c3-8f92-4c9a-a6e7-050cb75dd920\",\"nodeName\":\"长期\",\"type\":3,\"priorityLevel\":1,\"conditionMode\":1,\"conditionList\":[{\"label\":\"请假天数\",\"field\":\"day\",\"operator\":\">\",\"value\":\"7\"}],\"childNode\":{\"nodeId\":\"f1815fba-aa2a-4b9e-943c-d78d2275b34f\",\"nodeName\":\"领导审批77777777777777\",\"type\":1,\"setType\":1,\"nodeUserList\":[{\"id\":\"360000197302144442\",\"name\":\"何敏\"}],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"id\":\"c8c9020a-be4d-4233-b7fc-42e9c33b2930\",\"nodeName\":\"审核人4444444444444\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}}},{\"nodeId\":\"2282cfd8-43d3-4825-9425-aaf1b5e560ad\",\"nodeName\":\"短期\",\"type\":3,\"priorityLevel\":2,\"conditionMode\":1,\"conditionList\":[],\"childNode\":{\"nodeId\":\"bc97769c-b9ef-4271-9852-caf13ef2c208\",\"nodeName\":\"直接主管审批66666666666\",\"type\":1,\"setType\":2,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"id\":\"a4164e5c-cf8f-4457-968d-f1ae9ca900b7\",\"nodeName\":\"审核人5555555\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}}}],\"childNode\":{\"id\":\"1397e376-272a-4712-8f2d-abe40fde19d4\",\"nodeName\":\"审核人33333\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"id\":\"a1ba44cf-2189-4cac-9edd-5cec60aa51eb\",\"nodeName\":\"审核人111111\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"nodeId\":\"34c61f75-cb92-4051-8c31-45919118c54d\",\"nodeName\":\"抄送人\",\"type\":2,\"userSelectFlag\":true,\"nodeUserList\":[{\"id\":\"220000200908305857\",\"name\":\"何秀英\"}]}}}}}}";

    public static String str1="{\"nodeId\":\"b8a3ecbd-b7f8-4807-8ffe-85249088a180\",\"name\":\"请假审批\",\"nodeConfig\":{\"nodeId\":\"e98d084b-1b8b-4b31-8bfe-87d801f16235\",\"nodeName\":\"发起人\",\"type\":0,\"nodeRoleList\":[],\"childNode\":{\"nodeId\":\"8a36642d-377f-4452-b880-c061ee6b6be5\",\"nodeName\":\"条件路由\",\"type\":4,\"conditionNodes\":[{\"nodeId\":\"9ec8b5b5-1cd7-48a9-b642-d14365aeb49b\",\"nodeName\":\"长期\",\"type\":3,\"priorityLevel\":1,\"conditionMode\":1,\"conditionList\":[{\"label\":\"请假天数\",\"field\":\"day\",\"operator\":\">\",\"value\":\"7\"}],\"childNode\":{\"nodeId\":\"3ce860a3-651e-45c0-ae38-89b1714fa5b1\",\"nodeName\":\"领导审批11111111111\",\"type\":1,\"setType\":1,\"nodeUserList\":[{\"id\":\"360000197302144442\",\"name\":\"何敏\"}],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}},{\"nodeId\":\"2504809e-9c09-4917-b0f8-61ba8e92fcfc\",\"nodeName\":\"短期\",\"type\":3,\"priorityLevel\":2,\"conditionMode\":1,\"conditionList\":[],\"childNode\":{\"nodeId\":\"cff190a5-aafa-4397-80de-20da342c7760\",\"nodeName\":\"直接主管审批111111111\",\"type\":1,\"setType\":2,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"nodeId\":\"8063d9fb-7cd8-4915-8f2f-2c9b612bfa69\",\"nodeName\":\"审核人44444444444\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}}}],\"childNode\":{\"nodeId\":\"4706ad39-06eb-418c-9772-59aa7f140db8\",\"nodeName\":\"审核人33333333333333333\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"nodeId\":\"1d0abfe5-4924-4919-b96d-92e58b6d81e5\",\"nodeName\":\"审核人3333333333333\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"nodeId\":\"17c30dd4-1cdc-45d5-b3ae-1675a238fa23\",\"nodeName\":\"抄送人\",\"type\":2,\"userSelectFlag\":true,\"nodeUserList\":[{\"id\":\"220000200908305857\",\"name\":\"何秀英\"}]}}}}}}";


    public static String str3="{\"nodeId\":\"b7b77431-132d-4ee4-b6c9-913a0da74a20\",\"name\":\"请假审批\",\"nodeConfig\":{\"nodeId\":\"a2037bcc-3e9d-4fcc-a278-967d1f69d9f3\",\"nodeName\":\"发起人\",\"type\":0,\"nodeRoleList\":[],\"childNode\":{\"nodeId\":\"2571251d-1399-4aee-8995-623486a7b7f3\",\"nodeName\":\"条件路由\",\"type\":4,\"conditionNodes\":[{\"nodeId\":\"80027774-b3ac-47d4-9db1-d47f768f762f\",\"nodeName\":\"长期1111\",\"type\":3,\"priorityLevel\":1,\"conditionMode\":1,\"conditionList\":[{\"label\":\"请假天数\",\"field\":\"day\",\"operator\":\">\",\"value\":\"7\"}],\"childNode\":{\"nodeId\":\"502f7d50-d0f8-4be0-bdfa-4078599c1212\",\"nodeName\":\"领导审批555555\",\"type\":1,\"setType\":1,\"nodeUserList\":[{\"id\":\"360000197302144442\",\"name\":\"何敏\"}],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}},{\"nodeId\":\"cb838cad-59e6-4af6-9e7f-7f923f94436a\",\"nodeName\":\"短期2222\",\"type\":3,\"priorityLevel\":2,\"conditionMode\":1,\"conditionList\":[],\"childNode\":{\"nodeId\":\"bc5ba9df-c8a1-4790-92e7-3f64434a6e99\",\"nodeName\":\"直接主管审批6666666\",\"type\":1,\"setType\":2,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}},{\"nodeId\":\"7ce6b18a-6e23-439e-a756-066a2acf23b8\",\"nodeName\":\"条件333333\",\"type\":3,\"priorityLevel\":3,\"conditionMode\":1,\"conditionList\":[],\"childNode\":{\"nodeId\":\"7342350e-edab-4972-a9d8-fb15d1353649\",\"nodeName\":\"审核人77777\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}},{\"nodeId\":\"72707ddd-ddc1-4a8a-bfbb-4dce7f3006e1\",\"nodeName\":\"条件44444\",\"type\":3,\"priorityLevel\":4,\"conditionMode\":1,\"conditionList\":[],\"childNode\":{\"nodeId\":\"c5262040-f901-4eef-8a58-b3bbd2ad4ff9\",\"nodeName\":\"审核人888888\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}}],\"childNode\":{\"nodeId\":\"037a6794-dd2d-43e4-a115-dd95c207b913\",\"nodeName\":\"审核人999999\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"nodeId\":\"03214dd6-f181-4c34-8f89-340667b32166\",\"nodeName\":\"条件路由\",\"type\":4,\"conditionNodes\":[{\"nodeId\":\"1c240243-4dde-46d8-a0e1-7867634de477\",\"nodeName\":\"条件jjjjj\",\"type\":3,\"priorityLevel\":1,\"conditionMode\":1,\"conditionList\":[],\"childNode\":{\"nodeId\":\"8b51d6ec-a730-4097-a31e-fba9ee50ace6\",\"nodeName\":\"审核人kkkkkkkkk\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}},{\"nodeId\":\"c9de90bb-7945-40cf-aaec-beba57610410\",\"nodeName\":\"条件qqqqqqq\",\"type\":3,\"priorityLevel\":2,\"conditionMode\":1,\"conditionList\":[],\"childNode\":{\"nodeId\":\"59c19bce-6c9e-4be3-ae35-5f1a20773ba3\",\"nodeName\":\"审核人lllllllllllll\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0}}],\"childNode\":{\"nodeId\":\"fad9420b-2587-4009-862e-417f192eed18\",\"nodeName\":\"审核人mmmmm\",\"type\":1,\"setType\":1,\"nodeUserList\":[],\"nodeRoleList\":[],\"examineLevel\":1,\"directorLevel\":1,\"selectMode\":1,\"termAuto\":false,\"term\":0,\"termMode\":1,\"examineMode\":1,\"directorMode\":0,\"childNode\":{\"nodeId\":\"fd0b6282-b433-49d1-b39a-0f602fe2b896\",\"nodeName\":\"抄送人\",\"type\":2,\"userSelectFlag\":true,\"nodeUserList\":[{\"id\":\"220000200908305857\",\"name\":\"何秀英\"}]}}}}}}}";

    public static String str4="{\"name\":\"请假审批\",\"nodeId\":\"fcff08b5-5465-4d2a-b534-3b5b67efe1ee\",\"nodeConfig\":{\"nodeName\":\"发起人\",\"nodeRoleList\":[],\"type\":0,\"nodeId\":\"90963e61-23c3-4e24-a15d-8a6c5013d9a4\",\"childNode\":{\"nodeName\":\"审核人第一级\",\"examineLevel\":1,\"termMode\":1,\"nodeUserList\":[],\"examineMode\":1,\"type\":1,\"setType\":1,\"directorMode\":0,\"directorLevel\":1,\"childNode\":{\"nodeName\":\"条件路由\",\"conditionNodes\":[{\"nodeName\":\"长期\",\"conditionMode\":1,\"conditionList\":[{\"field\":\"day\",\"label\":\"请假天数\",\"value\":\"7\",\"operator\":\">\"}],\"priorityLevel\":1,\"type\":3,\"nodeId\":\"10ce176d-0e3d-44aa-938e-0ce56272308f\",\"childNode\":{\"nodeName\":\"领导审批\",\"examineLevel\":1,\"termMode\":1,\"nodeUserList\":[{\"name\":\"何敏\",\"id\":\"360000197302144442\"}],\"examineMode\":1,\"type\":1,\"setType\":1,\"directorMode\":0,\"directorLevel\":1,\"selectMode\":1,\"nodeRoleList\":[],\"term\":0,\"nodeId\":\"957778c4-3632-4499-bd6d-aa57583f405b\",\"termAuto\":false}},{\"nodeName\":\"短期\",\"conditionMode\":1,\"conditionList\":[],\"priorityLevel\":2,\"type\":3,\"nodeId\":\"2f6a9fdf-0ea9-412c-98a3-9cb82a5855f9\",\"childNode\":{\"nodeName\":\"直接主管审批\",\"examineLevel\":1,\"termMode\":1,\"nodeUserList\":[],\"examineMode\":1,\"type\":1,\"setType\":2,\"directorMode\":0,\"directorLevel\":1,\"selectMode\":1,\"nodeRoleList\":[],\"term\":0,\"nodeId\":\"7daa90a0-a4b6-42c2-8b52-695eb5737de6\",\"termAuto\":false}},{\"nodeName\":\"条件3\",\"conditionMode\":1,\"conditionList\":[],\"priorityLevel\":3,\"type\":3,\"nodeId\":\"a66eed47-cda3-47f8-ab6e-53bc2d83c3a3\",\"childNode\":{\"nodeName\":\"审核人\",\"examineLevel\":1,\"termMode\":1,\"nodeUserList\":[],\"examineMode\":1,\"type\":1,\"setType\":1,\"directorMode\":0,\"directorLevel\":1,\"selectMode\":1,\"nodeRoleList\":[],\"term\":0,\"nodeId\":\"9eee0fee-edd6-4de4-b054-350b9b557fb2\",\"termAuto\":false}}],\"type\":4,\"nodeId\":\"886d3260-ca28-4370-98bd-1f3fb0feb856\",\"childNode\":{\"nodeName\":\"审核人22222\",\"examineLevel\":1,\"termMode\":1,\"nodeUserList\":[],\"examineMode\":1,\"type\":1,\"setType\":1,\"directorMode\":0,\"directorLevel\":1,\"childNode\":{\"nodeName\":\"审核人33333\",\"examineLevel\":1,\"termMode\":1,\"nodeUserList\":[],\"examineMode\":1,\"type\":1,\"setType\":1,\"directorMode\":0,\"directorLevel\":1,\"childNode\":{\"nodeName\":\"抄送人\",\"nodeUserList\":[],\"type\":2,\"nodeId\":\"92695e30-a7d4-438d-99b8-9a68d443b880\",\"userSelectFlag\":true},\"selectMode\":1,\"nodeRoleList\":[],\"term\":0,\"nodeId\":\"f207a11c-f0e8-4fb2-94ab-b1d1c2b19153\",\"termAuto\":false},\"selectMode\":1,\"nodeRoleList\":[],\"term\":0,\"nodeId\":\"62bf62ba-e4bf-40ac-80b5-b4a57847d264\",\"termAuto\":false}},\"selectMode\":1,\"nodeRoleList\":[],\"term\":0,\"nodeId\":\"6e956a50-3b80-4177-ad4a-a421b1730f61\",\"termAuto\":false}}}";
    /**
     * 第一层直接读  childNode 是 json conditionNodes是jsonarray
     * 先读取 conditionNodes  后读取里面的 conditionList 条件  再决定是否走 childNode,在读 第一层的 childNode
     * 在读取 childNode
     *
     *
     * @param args
     */

    public static void main(String[] args) {
        JSONArray array=extractNodes(str4);
        System.out.println("流程开始了");
        dealStart(array);
    }

    //处理开始节点
    // type为4 条件节点 子节点为 3  非3 表示子节点走完后走 非3
    // type为2 抄送节点 直接通过
    // type为1 审批节点 需要审核通过才能继续
    public static void dealStart(JSONArray array){
        JSONObject start=getJSONObjectByType(array,"0");
        System.out.println("开始: "+start.toJSONString());
        JSONArray jsonArray=getJSONArrayByParentId(array,start.getString("nodeId"));
        for (int i = 0; i < jsonArray.size() ; i++) {
            JSONObject object=jsonArray.getJSONObject(i);
            System.out.println(object.toJSONString());
            String type=object.getString("type");
            if("4".equals(type)){
                dealTypeCondition(object,array);
            }else {
                dealType(object,array);
            }
        }
    }


    //处理type为4 条件路由
    public static void dealTypeCondition(JSONObject object,JSONArray array){
        System.out.println("::开始走条件开始");
        JSONArray jsonArray=getJSONArrayByParentId(array,object.getString("nodeId"));
        JSONObject json=null;
        Boolean isFirst=true;
        for (int i = 0; i < jsonArray.size() ; i++) {
            JSONObject obj=jsonArray.getJSONObject(i);
            String type=obj.getString("type");
            if("3".equals(type)){
                if(isFirst){
                    System.out.println(obj.toJSONString());
                    dealTypeConditionChild(obj,array);
                    isFirst=false;
                }
            }else {
                json=obj;
            }
        }
        //条件走完走这里
        if(json!=null){
            System.out.println("::开始走条件结束");
            System.out.println(json.toJSONString());
            dealType(json,array);
        }
    }

    public static void dealTypeConditionChild(JSONObject obj,JSONArray array){
        System.out.println("---------------------------------------------------------");
        JSONArray jsonArray=getJSONArrayByParentId(array,obj.getString("nodeId"));
        for (int i = 0; i < jsonArray.size() ; i++) {
            JSONObject jsonObject = jsonArray.getJSONObject(i);
            System.out.println("conditionChild: "+jsonObject.toJSONString());
            String type=obj.getString("type");
            if("4".equals(type)){
                dealTypeCondition(jsonObject,array);
            }else {
                dealType(jsonObject,array);
            }
        }
    }

    //处理type为1 审批节点 / 抄送
    public static void dealType(JSONObject object, JSONArray array){
        System.out.println("---------------------------------------------------------");
        JSONArray jsonArray=getJSONArrayByParentId(array,object.getString("nodeId"));
        for (int i = 0; i < jsonArray.size() ; i++) {
            JSONObject obj=jsonArray.getJSONObject(i);
            String type=obj.getString("type");
            if(type.equals("4")){
                System.out.println(obj.toJSONString());
                dealTypeCondition(obj,array);
            }else {
                System.out.println(obj.toJSONString());
                dealType(obj,array);
            }

        }
    }



    private static void put(Map<String,List<JSONObject>> map,String key,JSONObject jsonObject){
        if(!map.containsKey(key)){
            List<JSONObject> jsonObjectList=new ArrayList<>();
            map.put(key,jsonObjectList);
        }
        map.get(key).add(jsonObject);
    }



    public static JSONObject getJSONObjectByType(JSONArray array,String type){
        for (int i = 0; i < array.size() ; i++) {
            JSONObject obj = array.getJSONObject(i);
            if(obj.containsKey("type")){
                String type_=obj.getString("type");
                if(type_.equals(type)){
                    return obj;
                }
            }
        }
        return null;
    }

    public static JSONObject getJSONObjectById(JSONArray array,String nodeId){
        for (int i = 0; i < array.size() ; i++) {
            JSONObject obj = array.getJSONObject(i);
            if(obj.containsKey("nodeId")){
                String nodeId_=obj.getString("nodeId");
                if(nodeId_.equals(nodeId)){
                    return obj;
                }
            }
        }
        return null;
    }

    public static JSONArray getJSONArrayByParentId(JSONArray array,String parentId){
        JSONArray jsonArray=new JSONArray();
        for (int i = 0; i < array.size() ; i++) {
            JSONObject obj = array.getJSONObject(i);
            if(obj.containsKey("parentNode")){
                String parentNode_=obj.getString("parentNode");
                if(parentNode_!=null && parentNode_.equals(parentId)){
                    jsonArray.add(obj);
                }
            }
        }
        return jsonArray;
    }


    public static JSONArray extractNodes(String jsonData) {
        JSONArray result = new JSONArray();

        try {
            // 解析传入的 JSON 数据
            JSONObject jsonObj = JSONObject.parseObject(jsonData);
            // 提取根节点信息
            JSONObject rootNode = jsonObj.getJSONObject("nodeConfig");
            extractNodeInfo(rootNode, null, result);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return result;
    }

    private static void extractNodeInfo(JSONObject node, String parentNodeId, JSONArray result) throws JSONException {
        // 提取当前节点信息
        String nodeId = node.getString("nodeId");
        String nodeName = node.getString("nodeName");
        Integer nodeType=node.getInteger("type");
        // 构建当前节点信息的 JSON 对象
        JSONObject currentNode = new JSONObject();
        currentNode.put("nodeId", nodeId);
        currentNode.put("nodeName", nodeName);
        currentNode.put("parentNode", parentNodeId);
        currentNode.put("type",nodeType);

        // 将当前节点信息添加到结果数组中
        result.add(currentNode);

        // 处理子节点信息
        if (node.containsKey("childNode")) {
            JSONObject childNode = node.getJSONObject("childNode");
            extractNodeInfo(childNode, nodeId, result);
        }

        if (node.containsKey("conditionNodes")) {
            JSONArray conditionNodes = node.getJSONArray("conditionNodes");
            for (int i = 0; i < conditionNodes.size(); i++) {
                JSONObject conditionNode = conditionNodes.getJSONObject(i);
                extractNodeInfo(conditionNode, nodeId, result);
            }
        }
    }

}
